<!DOCTYPE html>
<html lang="zh">
<head>
    <title>收藏记录 - 派后台管理系统</title>
    {include file="public/header" /}
</head>
<body>
<div class="container-fluid p-t-15">
    <div class="row">
        <div class="col-lg-12">
        <div class="card-header"><h4>搜索</h4></div>
                <div class="card-body">
                    <form class="form-inline searchForm" onsubmit="return false;">
                        
                        <div class="form-group">
                            <label for="phone">手机号</label>
                            <div class="input-group">
                                <div class="input-group">
                                    <input type="text" class="form-control" id="phone" value="" name="phone" placeholder="请输入手机号">
                                </div>
                            </div>
                        </div>
                        <button type="submit" class="btn btn-success" style="margin: -10px 0 0 10px;" id="search">搜索</button>
                    </form>
                </div>
        </div>
        <div class="col-lg-12">
            <div class="card">
                <div class="card-header"><h4>收藏记录</h4></div>
                <div class="card-body">
                    <div id="toolbar" class="toolbar-btn-action">
                        
                    </div>
                    <table id="tb_departments">
                       
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer"/}
<script type="text/javascript">
    $('#tb_departments').bootstrapTable({
        classes: 'table table-bordered table-hover table-striped',
        url: '/admin/product.product_record/apply_lst',
        method: 'post',
        dataType : 'json',        // 因为本示例中是跨域的调用,所以涉及到ajax都采用jsonp,
        uniqueId: 'id',
        idField: 'id',             // 每行的唯一标识字段
        toolbar: '#toolbar',       // 工具按钮容器
        showColumns: true,         // 是否显示所有的列
        showRefresh: true,         // 是否显示刷新按钮
        responseHandler: function (res) {
            return {
                "total": res.count,
                "rows": res.data,
            };
        },
        pagination: true,
        queryParams: function(params) {
            var temp = toArrayList($(".searchForm").serializeArray());
            temp['limit'] = params.limit;
            temp['page'] = (params.offset / params.limit) + 1;
            return temp;
        },
        sidePagination: "server",
        pageNumber: 1,
        pageSize: 20,
        pageList: [20, 50, 100],
        columns: [ {
            field: 'avatar',
            title: '头像',
            align: "center",
            formatter:function (value,row,index) {
                if (value == "") return "";
                return '<img src="'+value+'" style="width: 64px;"/>';
            },
        },  {
            field: 'nickname',
            title: '昵称',
            align: "center"
        }, {
            field: 'phone',
            title: '手机号',
            align: "center"
        },
        {
            field: 'product',
            title: '收藏产品',
            align: "center",
            formatter:function (value,row,index) {
                return value;
            },
        },
        {
            field: 'create_time',
            title: '收藏时间',
            align: "center"
        }],

    });

    $("#search").click(function () {
        $('#tb_departments').bootstrapTable('refresh', {});
    });
</script>
</body>
</html>